package cn.ac.van.imeigen.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author myd
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespModel {
    private Integer code;
    private String msg;

    public RespModel(Boolean isSuccess, String data) {
        if (isSuccess) {
            this.code = 0;
            this.msg = "成功";
        } else {
            this.code = -1;
            this.msg = "失败";
        }
    }

    public RespModel(Boolean isSuccess) {
        if (!isSuccess) {
            this.code = -1;
            this.msg = "失败";
        }
    }
}
